$(function(){
		
	//阻止菜单事件冒泡
	$("#mymenu>li").children('.submenu').click(function (event) {
	    event.stopPropagation();
	})
	//meun
	$("#mymenu>li").click(function () {
	    if ($(this).hasClass('active')) {
	        $(this).removeClass("active").children('.submenu').slideUp("fast", function () {
	           
	        });
	        
	    } else {
	        $(this).addClass("active").siblings().removeClass("active");
	        $(this).children(".submenu").slideDown("fast", function () {
	         
	        }).parent().siblings().children(".submenu").slideUp("fast");
	    }
	    
	}).has(".submenu").children("a").append("<b class='icon-angle-down'></b>");//对有子菜单的menu添加下拉图标
	
	//菜单展开折叠
	 $("#menu-collapse").on('click', function (event, isauto) {
	 	if ($(this).data("open") == "open" ) {//收缩
	        $(this).css("right","-20px").children().removeClass().addClass("icon-double-angle-right");
	        $(this).parents(".main-left").animate({left:"-202px"}, 300, function(){
	           
	        });
	        $(this).data("open","close");
	        $("#mainRight").css("margin-left", "20px")
	
	    } else if ($(this).data("open") == "close") {//展开
	        $(this).parents(".main-left").animate({left:"0px"}, 300, function(){
	           
	        });
	        $(this).css("right","0px").children().removeClass().addClass("icon-double-angle-left");
	        $(this).data("open","open");
	        $("#mainRight").css("margin-left","202px")
	    }
	})
		
})